//
//  FileDownLoadService.h
//  Bus_iPhone
//
//  Created by 黄修勇 on 12-9-2.
//
//

#import <Foundation/Foundation.h>
#import "ASINetworkQueue.h"
#import "ASIHTTPRequest.h"

#define FILE_DOWN_DEFAULT_MAX_COUNT     3
#define DOWN_FILE_DEFAULT_TIME_OUT      15.0f


@protocol FileDownLoadDelegate <NSObject>

@optional

-(void)fileDownLoadFailed:(ASIHTTPRequest *)request;

-(void)fileDownLoadSuccess:(ASIHTTPRequest *)request;

-(void)allFileDidDownLoad;

@end

@interface FileDownLoadService : NSObject<ASIHTTPRequestDelegate>{

    ASINetworkQueue *queue;
}

@property (nonatomic,assign)id<FileDownLoadDelegate>delegate;

-(void)downLoadFileWithURL:(NSURL *)url tempPath:(NSString *)tempPath filePath:(NSString *)path progressDelegate:(id)delegate;

-(BOOL)cancelDownLoadFileWithURL:(NSURL *)url;

-(BOOL)setDownLoadProgressDelegate:(id)progressDelegate url:(NSURL *)url;

-(ASIHTTPRequest *)requestForURL:(NSURL *)url;


@end
